import koa from 'koa';
import views from 'koa-views';
import Router from 'koa-router';
import path from 'path';

const router = Router();
router.get('/login',async (ctx) => {
    let title = "hello jwt";
    // 和 SSR 有什么关系？
    await ctx.render('index',{
        title
    })
})


const app = new koa();
app.use(
    views(path.join(__dirname,'./views'),{
        extension:'ejs'
}))

app
  .use(router.routes())
  .use(router.allowedMethods());

app.listen(1234,() => {
    console.log('服务启动起来了');
})